package com.hmall.mapper;

import com.hmall.model.MallComment;
import com.hmall.util.MyMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.Date;
import java.util.List;

@Repository
public interface MallCommentMapper extends MyMapper<MallComment> {

    List<MallComment> listComment(@Param("productId") Integer productId);

    int selectCountByProduct(@Param("productId") Integer productId);

    List<MallComment> selectByProductId(@Param("productId") Integer productId);

    void updateCommentNum(@Param("commentId") Integer commentId, @Param("commentTime") Date commentTime);

    MallComment selectByOrderItemId(@Param("orderItemId") Integer order_item_id);

    List<MallComment> selectByOrderItemIdList(@Param("mallOrderItemIdList") List<Integer> mallOrderItemIdList);



    void myInsert(@Param("mallComment") MallComment mallComment);

    void updateComment(@Param("commentId") Integer commentId, @Param("anoymous") Integer anoymous, @Param("evaluate") String evaluate, @Param("images") String images, @Param("packingRank") int packingRank,
                       @Param("logisticsRank") int logisticsRank, @Param("serviceRank") int serviceRank, @Param("qualityRank") int qualityRank,
                       @Param("saleAfterRank") int saleAfterRank, @Param("technicalAfterRank") int technicalAfterRank, @Param("rank") double rank);

    void updateStar(@Param("commentId") Integer commentId);
}